#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include"showimage.h"
#include<QQmlContext>
#include<QQmlImageProviderBase>
#include"colorimageprovider.h"
int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);

    QQmlApplicationEngine engine;
    ShowImage *CodeImage = new ShowImage;
    engine.rootContext()->setContextProperty("CodeImage",CodeImage);
    engine.addImageProvider(QLatin1String("CodeImg"), CodeImage->m_pImgProvider);
    engine.addImageProvider(QLatin1String("colors"), new ColorImageProvider );
    engine.load(QUrl(QStringLiteral("qrc:/main.qml")));

    if (engine.rootObjects().isEmpty())
        return -1;

    return app.exec();
}
